package LogServer.constants

import LogServer.utils.PropertiesUtil



/**
  * Created by root on 17-2-10.
  */
// 私有构造方法
class PropertiesZookeeper private() {

}

// 伴生对象，与类共享名字，可以访问类的私有属性和方法
object PropertiesZookeeper{
  /**
    * get zkQuorum path in proerperties
    * @return zkQuorum path
    */
  def getZkQuorum(): String = {
    val propertiesUtil = new PropertiesUtil()
    val resource = propertiesUtil.loadResources("zookeeper.properties")
    val path = propertiesUtil.getString("path",resource)
    val zkProperties = propertiesUtil.loadProperties(path)
    val zkQuorum = propertiesUtil.getString("zkQuorum",zkProperties)
    zkQuorum
  }

  def main(args: Array[String]): Unit = {
//    println(System.getProperty("user.dir"))
    println(getZkQuorum())
  }
}
